package jfae.core.properties.parsers.annotation;

import jfae.core.annotations.Presentation;
import jfae.core.properties.FieldInfo;
import jfae.core.properties.parsers.execution.constraints.ExecuteAfter;

//TODO: inserire un sistema di constraints per l'ordine di 
//esecuzione degli annotation handlers
@ExecuteAfter(EditableHandler.class) //potrebbe essere una delle constraints
public class PresentationHandler implements AnnotationHandler<Presentation> {

	@Override
	public void handle(Presentation presentation, FieldInfo<?> info) {
		info.setLabel(presentation.label());
		info.setFieldSize(presentation.fieldSize());
		info.setColumnSize(presentation.columnSize());
		info.setStyles(presentation.styles());
		info.setStyleClass(presentation.styleClass());
		info.setFieldLength(presentation.fieldLength());
		info.setFormat(presentation.format());
	}

	@Override
	public Class<Presentation> getType() {
		return Presentation.class;
	}

}
